package com.ishare.api.po.login;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;

/**
 * @author 李嘉宾
 */
@Data
@ApiModel(description = "用户注册提交参数")
public class UserRegisterParam {

    /**
     * 用户名
     */
    @NotEmpty(message = "用户名不能为空")
    @ApiParam(value = "用户名")
    private String userName;

    /**
     * 邮箱
     */
    @NotEmpty(message = "邮箱不能为空")
    @Email(message = "请输入正确的邮箱格式",regexp = "^([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+\\.[a-zA-Z]{2,3}$")
    @ApiParam(value = "邮箱")
    private String email;

    /**
     * 密码
     */
    @NotEmpty(message = "密码不能为空")
    @ApiParam(value = "密码")
    @Length(min = 6, max = 18, message = "密码最少6位,最大18位")
    private String password;


    /**
     * 邮箱验证码
     */
    @NotEmpty(message = "邮箱验证码不能为空")
    @ApiParam(value = "邮箱验证码")
    private String emailCode;

}
